/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. 
 */
package com.icinfo.cloud.provider.punish.ucase.punishinform.controller;

import com.icinfo.cloud.common.core.Validator.BaseGroup;
import com.icinfo.cloud.provider.punish.ucase.punishinform.dto.*;
import com.icinfo.cloud.provider.punish.ucase.punishinform.service.IInformInvestigationEndService;
import com.icinfo.cloud.provider.punish.ucase.punishinform.vo.InformInvestigationEndFormVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * 【V1.3.1】描述:  调查终结对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2022年02月13日
 */
@RestController
@RequestMapping("/punish/inform/investigationEnd")
public class InformInvestigationEndController extends BaseController {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(InformInvestigationEndController.class);

    @Autowired
    private IInformInvestigationEndService iInformInvestigationEndService;

    /**
     * 【V1.0.0】描述：获取调查终结表单数据
     * @author liyafeng
     * @date 2022/2/16
      * @param request
     * @return {@link Result< InformInvestigationEndFormVo>}
     */
    @PostMapping(value = "/getInformInvestigationEndFormBaseinfo",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<InformInvestigationEndFormVo> getInformInvestigationEndFormBaseinfo(@RequestBody @Validated(BaseGroup.Query.class) InvestigationEndRequest request){
        return iInformInvestigationEndService.getInformInvestigationEndFormBaseinfo(request);
    }
    /**
     * 【V1.0.0】描述：保存表单数据-调查终结
     * @author liyafeng
     * @date 2022/2/17
      * @param informInvestigationEndFormDto
     * @return {@link Result< String>}
     */
    @PostMapping(value = "/saveInformInvestigationEndForm",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> saveInformInvestigationEndForm(@RequestBody @Validated(BaseGroup.Query.class) InformInvestigationEndFormDto informInvestigationEndFormDto){
        return iInformInvestigationEndService.saveInformInvestigationEndForm(informInvestigationEndFormDto);
    }

    /**
     * 【V1.3.1】描述： 查询是否需要集体议案
     *
     * @author: zhengqiang
     * @date: 2022/7/11
     * @param: isNeedCollectiveDiscussCheckDto
     * @return {@link Result< String>}
     **/
    @PostMapping(value = "/getIsNeedCollectiveDiscussResult")
    public Result<String> getIsNeedCollectiveDiscussResult(@RequestBody @Validated IsNeedCollectiveDiscussCheckDto isNeedCollectiveDiscussCheckDto){
        return iInformInvestigationEndService.getIsNeedCollectiveDiscussResult(isNeedCollectiveDiscussCheckDto);
    }
    /**
     * 简案快办补充信息保存
     * @author liyafeng
     * @date 2023/4/20
      * @param fastCaseAddInfoDto
     * @return {@link Result< String>}
     */
    @PostMapping(value = "/saveFastCaseAddInfo",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> saveFastCaseAddInfo(@RequestBody @Validated FastCaseAddInfoDto fastCaseAddInfoDto){
        int num=iInformInvestigationEndService.saveFastCaseAddInfo(fastCaseAddInfoDto);
        if(num>0){
            return Result.success("保存成功");
        }
        return Result.error("保存失败");
    }
    /**
     * 简案快办补充信息暂存
     * @author liyafeng
     * @date 2023/5/6
      * @param fastCaseAddInfoDto
     * @return {@link Result< String>}
     */
    @PostMapping(value = "/saveFastCaseAddInfoTemporary",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<String> saveFastCaseAddInfoTemporary(@RequestBody  FastCaseAddInfoDto fastCaseAddInfoDto){
        int num=iInformInvestigationEndService.saveFastCaseAddInfoTemporary(fastCaseAddInfoDto);
        if(num>0){
            return Result.success("保存成功");
        }
        return Result.error("保存失败");
    }
    /**
     * 简案快办补充信息暂存获取
     * @author liyafeng
     * @date 2023/5/6
      * @param dto
     * @return {@link Result< FastCaseAddInfoDto>}
     */
    @PostMapping(value = "/getFastCaseAddInfoTemporary",produces = MediaType.APPLICATION_JSON_VALUE)
    public Result<FastCaseAddInfoDto> getFastCaseAddInfoTemporary(@RequestBody @Validated FastCaseAddInfoTemporaryDto dto){
        FastCaseAddInfoDto fastCaseAddInfoDto=iInformInvestigationEndService.getFastCaseAddInfoTemporary(dto);
        return Result.success("获取成功",fastCaseAddInfoDto);
    }



}